#!/bin/bash
sdkpath=$(pwd)

ln -s $sdkpath/ffmpeg-4-4-4/bin/* /usr/bin
ln -s $sdkpath/ffmpeg-4-4-4/lib/* /usr/lib
ln -s $sdkpath/ffmpeg-4-4-4/lib/pkgconfig/* /usr/lib/pkgconfig
ln -s $sdkpath/ffmpeg-4-4-4/include/* /usr/include

ln -s $sdkpath/jdk1.8.0_121/bin/* /usr/bin
ln -s $sdkpath/jdk1.8.0_121/lib/* /usr/lib
ln -s $sdkpath/jdk1.8.0_121/lib/amd64/* /usr/lib/amd64
ln -s $sdkpath/jdk1.8.0_121/include/* /usr/include
ln -s $sdkpath/jdk1.8.0_121/jre/* /usr/jre
ln -s $sdkpath/jdk1.8.0_121/man/* /usr/man

cat > /etc/profile.d/sdk.sh << EOF
#!/bin/bash
# java 环境变量
export JAVA_HOME=$sdkpath/jdk1.8.0_121
export JAVA_BIN=\$JAVA_HOME/bin
export JAVA_INCLUDE_PATH2=\$JAVA_HOME/include/linux:\$JAVA_HOME/include


export TOOLS_FFMPEG=$sdkpath/ffmpeg-4-4-4
export PKG_CONFIG_PATH=\$TOOLS_FFMPEG/lib/pkgconfig:\$TOOLS_FFMPEG/lib64/pkgconfig
export LD_LIBRARY_PATH=\$TOOLS_FFMPEG/lib


# 执行文件路径
export PATH=\$ANDROID_SDK_HOME/cmdline-tools/latest/bin:\$NDK_BIN:\$JAVA_BIN:\$MY_FFMPEG/bin:\$TOOLS_FFMPEG/bin:\$PATH
EOF

source /etc/profile
ldconfig


cat > /etc/profile.d/sdk.sh << EOF
#!/bin/bash
# java 环境变量
export JAVA_HOME=/mnt/sdk/java/jdk-21.0.2
export JAVA_BIN=\$JAVA_HOME/bin
# 执行文件路径
export PATH=\$JAVA_BIN:\$PATH
EOF

















